<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 600px;
            height: 400px;
            /* border: 1px solid #000; */
            margin: 0 auto;
        }

        ul {
            width: 100%;
            height: 200px;
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            margin-left: -40px;
        }

        li {
            list-style: none;
            width: 18%;
            height: 140px;
            text-align: center;
            padding-top: 50px;
            box-sizing: border-box;
            /* border: 1px solid #000; */
            background-color: #f2f2f2;
            border: 1px solid #000;
            position: relative;
        }

        img {
            position: absolute;
            top: 0;
            left: -10px;
            display: none;
        }
    </style>
</head>

<body>
    <div>
        <ul>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
            <li>
                Lamborghini
                <br>
                兰博基尼
                <img src="./1.jpg" alt=""></li>
        </ul>
    </div>
</body>

</html>
<script>
    var lis = document.querySelectorAll('li')
    var imgs = document.querySelectorAll('img')
    for (var i = 0; i < lis.length; i++) {
        lis[i].onmouseover = function () {
            for(var s = 0 ; s < lis.length ; s++){
                // lis[s].style.opacity = '1'
            lis[s].children[1].style.display = 'none'
            }
            // this.style.opacity = '0'
            this.children[1].style.display = 'block'
        }
    }
</script>